/*
 * 
 *      Demo
 * 
 *      功能：
 *          登录窗口
 *      
 *      2023.8.27
 *
 *
 */


using System.Collections;
using System.Collections.Generic;
using UIFramework;
using UnityEngine;
using UnityEngine.UI;

namespace DemoProject
{

    public class LoginUIForm : BaseUIForm
    {
        public Text TxtLogonName;       //登陆名称
        public Text TxtLogonNameByBtn;  //登陆名称(Button）

        private void Awake()
        {
            //定义本窗体的性质(默认数值)
            base.CurrentUIType.UIForms_Type = UIFormType.Normal; 
            base.CurrentUIType.UIForms_ShowMode = UIFormShowMode.Normal; 
            base.CurrentUIType.UIForm_LucencyType = UIFormLucenyType.Lucency;
            //给按钮注册事件
            base.RigisterButtonObjectEvent("Btn_OK", LoginSys);
        }

        private void Start()
        {
            string strDisplayInfo = Show("LogonSystem");
            if (TxtLogonName)
            {
                TxtLogonName.text = strDisplayInfo;
            }
            if (TxtLogonNameByBtn)
            {
                TxtLogonNameByBtn.text = strDisplayInfo;
            }
        }

        /// <summary>
        ///  登录按键
        /// </summary>
        public void LoginSys(GameObject go)
        {
            print("登陆方法被执行");
            //前台或者后台检查用户名称与密码

            //如果成功，则登陆下一个窗体。
            base.OpenUIForm(ProConst.SELECT_HERO_FORM);
        }
    }
}
